//package CSV2RDFTest;
//
//import Csv2RDF.RelationExtraction;
//import ConicalSurface;
//import CylindricalSurface;
//import Face;
//import ToroidalSurface;
//import org.junit.Test;
//
//import java.util.Arrays;
//import java.util.HashMap;
//
//import static org.apache.jena.atlas.lib.RandomLib.random;
//
//public class CAD2Json {
//  @Test
//  public void surfaceExtraction() {
//
//
//    CylindricalSurface f1 = new CylindricalSurface();
//    CylindricalSurface f2 = new CylindricalSurface();
//    ConicalSurface f3 = new ConicalSurface();
//    ConicalSurface f4 = new ConicalSurface();
//    ToroidalSurface f5 = new ToroidalSurface();
//    ToroidalSurface f6 = new ToroidalSurface();
//
//    f1.setId(String.valueOf(random.nextInt(1000000))); // 0 到 999999 的随机整数
//    f2.setId(String.valueOf(random.nextInt(1000000)));
//    f3.setId(String.valueOf(random.nextInt(1000000)));
//    f4.setId(String.valueOf(random.nextInt(1000000)));
//    f5.setId(String.valueOf(random.nextInt(1000000)));
//    f6.setId(String.valueOf(random.nextInt(1000000)));
//
//    String[][] csvArray = {
//        {"", f1.getId(), f2.getId(), f3.getId(), f4.getId(), f5.getId(), f6.getId()},
//        {f1.getId(), "", "coaxialContain", "parallel", "coaxialPartOverlap,coplanar,overlapped", "coplanar", "perpendicular"},
//        {f2.getId(), "", "", "intersecting", "intersecting", "intersecting", "intersecting"},
//        {f3.getId(), "", "", "", "perpendicular", "coaxialAdjoining", "coaxialDisjoint"},
//        {f4.getId(), "", "", "", "", "parallel,coaxialContain", "intersecting"},
//        {f5.getId(), "", "", "", "", "", "overlapped"},
//        {f6.getId(), "", "", "", "", "", ""}
//    };
//    HashMap<String, Face> faceMap = new HashMap<>();
//    faceMap.put(f1.getId(), f1);
//    faceMap.put(f2.getId(), f2);
//    faceMap.put(f3.getId(), f3);
//    faceMap.put(f4.getId(), f4);
//    faceMap.put(f5.getId(), f5);
//    faceMap.put(f6.getId(), f6);
//
//    RelationExtraction.relationExtraction(csvArray, faceMap);
////    f1.getRelations().forEach((k, v) -> {
////      System.out.println("Face:" + k.getId());
////      v.forEach(System.out::println);
////    });
//    String[][] csvArrayComplete = {
//        {"", f1.getId(), f2.getId(), f3.getId(), f4.getId(), f5.getId(), f6.getId()},
//        {f1.getId(), "", f1.getRelations().get(f2).toString(), f1.getRelations().get(f3).toString(), f1.getRelations().get(f4).toString(), f1.getRelations().get(f5).toString(), f1.getRelations().get(f6).toString()},
//        {f2.getId(), f2.getRelations().get(f1).toString(), "", f2.getRelations().get(f3).toString(), f2.getRelations().get(f4).toString(), f2.getRelations().get(f5).toString(), f2.getRelations().get(f6).toString()},
//        {f3.getId(), f3.getRelations().get(f1).toString(), f3.getRelations().get(f2).toString(), "", f3.getRelations().get(f4).toString(), f3.getRelations().get(f5).toString(), f3.getRelations().get(f6).toString()},
//        {f4.getId(), f4.getRelations().get(f1).toString(), f4.getRelations().get(f2).toString(), f4.getRelations().get(f3).toString(), "", f4.getRelations().get(f5).toString(), f4.getRelations().get(f6).toString()},
//        {f5.getId(), f5.getRelations().get(f1).toString(), f5.getRelations().get(f2).toString(), f5.getRelations().get(f3).toString(), f5.getRelations().get(f4).toString(), "", f5.getRelations().get(f6).toString()},
//        {f6.getId(), f6.getRelations().get(f1).toString(), f6.getRelations().get(f2).toString(), f6.getRelations().get(f3).toString(), f6.getRelations().get(f4).toString(), f6.getRelations().get(f5).toString(), ""}
//    };
//
//    for (String[] strings : csvArrayComplete) {
//      System.out.println(Arrays.toString(strings));
//    }
//  }
//}
